Add kimi_vl, minicpm_v_4d5, glm_4d1v, ovis2, aria, qwen3d5 infer code - #147
Conversation
- mmeval/infer/{kimi_vl,minicpm_v_4d5,glm_4d1v,ovis2,aria}.py
- env_files/{kimi_vl,minicpm_v_4d5,glm_4d1v,ovis2,aria}_requirements.txt
- mmeval/registry.py: series_mapping + series_infer_env_mapping entries
Models:
- kimi_vl: moonshotai/Kimi-VL-A3B-Instruct, Kimi-VL-A3B-Thinking
- minicpm_v_4d5: openbmb/MiniCPM-V-4_5
- glm_4d1v: THUDM/GLM-4.1V-9B-Thinking, GLM-4.1V-9B-Base
- ovis2: AIDC-AI/Ovis2-{1B,2B,4B,8B,16B,34B}
- aria: rhymes-ai/Aria
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds the official Qwen3.5 multimodal series to the same branch alongside
the previous 5 series. Qwen3.5 is a unified vision-language model (no
separate -VL suffix); architecture: Qwen3_5ForConditionalGeneration with
Qwen3VLProcessor.
Models: Qwen/Qwen3.5-{0.8B,2B,4B,9B,27B,35B-A3B,122B-A10B,397B-A17B}
and Base / FP8 / GPTQ-Int4 variants.
HF: https://huggingface.co/Qwen/Qwen3.5-9B
GH: https://github.com/QwenLM/Qwen3.5
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- ovis2: registered variants narrowed to Ovis2-{1B,2B,4B,8B} (all tested).
Larger Ovis2-{16B,34B} variants are de-registered to keep the registry
to tested-only variants.
- qwen3d5: registered variants narrowed to Qwen3.5-{0.8B,2B,4B,9B}. Larger
variants (27B / 35B-A3B / 122B-A10B / 397B-A17B and their Base/FP8/GPTQ
flavors) are de-registered for the same reason; they can be reintroduced
in a follow-up once tested.
- env_files/glm_4d1v_requirements.txt: add av (PyAV) — the Glm4v processor's
video path requires it via torchvision.io.
The previous parse_input concatenated all text fragments and appended them at the end of the content list, breaking interleave order for prompts where images appear between text chunks (e.g. 'Image A <image> and Image B <image>'). Append text chunks in position so the multi-image interleave path matches the official model.chat() expectations.
Previous defaults (512/1024/8192) replaced with a uniform 2048 for the six newly added series. 2048 is the project-wide normal upper bound; no model needs a lower limit.
There was a problem hiding this comment.
Pull request overview
Adds six new multimodal model series integrations to simple-mmeval, wiring each series into the registry and providing per-series inference runners plus environment requirement files (defaulting to max_new_tokens=2048).
Changes:
- Register 6 new model series (
kimi_vl,minicpm_v_4d5,glm_4d1v,ovis2,aria,qwen3d5) inmmeval/registry.pyand map them to env + infer entrypoints. - Add inference implementations for the 6 series under
mmeval/infer/. - Add per-series environment requirement files under
env_files/.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mmeval/registry.py | Adds series name→model-name registry entries and env/infer mappings for the 6 new series. |
| mmeval/infer/kimi_vl.py | Adds inference runner for Kimi-VL-A3B variants (text + multi-image interleave). |
| mmeval/infer/minicpm_v_4d5.py | Adds inference runner for MiniCPM-V-4_5 (text + multi-image interleave). |
| mmeval/infer/glm_4d1v.py | Adds inference runner for GLM-4.1V (text + multi-image/video interleave). |
| mmeval/infer/ovis2.py | Adds inference runner for Ovis2 (text + multi-image interleave). |
| mmeval/infer/aria.py | Adds inference runner for Aria (text + multi-image interleave). |
| mmeval/infer/qwen3d5.py | Adds inference runner for Qwen3.5 unified VL family (text + multi-image/video interleave). |
| env_files/kimi_vl_requirements.txt | Defines per-series Python deps for kimi_vl. |
| env_files/minicpm_v_4d5_requirements.txt | Defines per-series Python deps for minicpm_v_4d5. |
| env_files/glm_4d1v_requirements.txt | Defines per-series Python deps for glm_4d1v. |
| env_files/ovis2_requirements.txt | Defines per-series Python deps for ovis2. |
| env_files/aria_requirements.txt | Defines per-series Python deps for aria. |
| env_files/qwen3d5_requirements.txt | Defines per-series Python deps for qwen3d5. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| torch==2.6.0 | ||
| torchvision==0.21.0 | ||
| transformers @ git+https://github.com/huggingface/transformers.git@main | ||
| accelerate |
There was a problem hiding this comment.
Thanks for the suggestion. I considered the reproducibility benefit, but reverted the fixed transformers commit pin to keep the integration closer to the official Qwen3.5 dependency setting (the model card explicitly asks for the latest transformers from main). Since there is no confirmed functional issue requiring a pinned internal commit, I prefer to follow the official setup here.
| text = self.processor.apply_chat_template( | ||
| user_message, add_generation_prompt=True, return_tensors="pt", | ||
| ) | ||
| proc_kwargs = {"text": text, "return_tensors": "pt", "padding": True, "truncation": True} | ||
| if images: | ||
| proc_kwargs["images"] = images | ||
| inputs = self.processor(**proc_kwargs).to(self.model.device) |
There was a problem hiding this comment.
Thanks for the review. I checked this against the official Kimi-VL README, which uses the same processor.apply_chat_template(..., return_tensors="pt") → processor(images=image, text=text, ...) pattern; the Kimi-VL processor accepts pre-tokenized ids here. The tests pass end-to-end, so I kept the official pattern to preserve upstream fidelity.
215af03 to
2911c6b
Compare
- mmeval/infer/aria.py: strip a single trailing <|im_end|>. - mmeval/infer/glm_4d1v.py: strip a single trailing <|user|>. Useful structure such as </think>, <answer>...</answer>, and <|begin_of_box|>...<|end_of_box|> is preserved. mmeval/infer/qwen3d5.py does not postprocess model output.
2911c6b to
28f7071
Compare
Description
Add 6 new multimodal model series to the framework. All inference files default to
max_new_tokens=2048. Companion test-result PR: #148.kimi_vlminicpm_v_4d5glm_4d1vovis2ariaqwen3d5Qwen3.5 is the official unified vision-language family (
Qwen3_5ForConditionalGeneration+Qwen3VLProcessor); see https://qwen.ai/blog?id=qwen3.5 and https://github.com/QwenLM/Qwen3.5.This PR contains infer/model-code changes only.
Files:
mmeval/infer/{kimi_vl,minicpm_v_4d5,glm_4d1v,ovis2,aria,qwen3d5}.pyenv_files/{kimi_vl,minicpm_v_4d5,glm_4d1v,ovis2,aria,qwen3d5}_requirements.txtmmeval/registry.pyType of Change
Testing
Test command used:
Checklist
mmeval/registery.py(if new model)